package _04xpath绝对路径;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Node;
import org.dom4j.io.SAXReader;

import java.util.List;

public class Demo4 {
    public static void main(String[] args) throws DocumentException {
        SAXReader reader = new SAXReader();
        Document document = reader.read("Day_14\\xpath_contact.xml");

        //绝对路径
        List<Node> nodes = document.selectNodes("/contactList/contact/name");
        for (Node node : nodes) {

            System.out.println(node.getText());
        }



    }
}
